if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_UpdateFactory]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_UpdateFactory]
GO
CREATE PROC sp_UpdateFactory
	@id			int,
	@facName	nvarchar(200),
	@phone		varchar(20),
	@facDes		nvarchar(2000),
	@status		int
AS
BEGIN
	UPDATE Factory
		SET
			FactoryName = @facName, Phone = @phone, Description = @facDes, Status = @status
		WHERE ID = @id
END